from django.conf.urls import url,include
from django.contrib import admin
from . import views

urlpatterns = [
    # url(r'^admin/', admin.site.urls),
    url(r'^registers/$', views.RegisterView.as_view(),name="registers"),
    # 验证帐号是否重复
    url(r'^usernames/(?P<username>[a-zA-Z0-9_-]{5,20})/count/$',views.UserCountView.as_view()),
    # 验证手机号是否重复
    url(r'^mobiles/(?P<mobile>1[3-9]\d{9})/count/$', views.MobileView.as_view()),
    # 登录界面
    url(r'^login', views.LoginView.as_view() ,name="login"),
    # 退出界面
    url(r'^logout$', views.LogoutView.as_view() ,name="logout"),
    # 用户中心页面
    url(r'^center$', views.CenterView.as_view() ,name="center") ,
    # 绑定邮箱
    url(r'^emails/$', views.EmailView.as_view() ,name="email") ,
    # 验证邮箱
    url(r'^emails/verification/$', views.VerifyemailView.as_view() ,name="verifyemail") ,
    # 显示收货地址
    url(r'^address/$', views.AddressView.as_view(), name="address"),
    # 实现新增收货地址
    url(r'^addresses/create/$', views.AddaddressView.as_view(), name="addaddress"),
    # 修改收获地址
    url(r'^addresses/(?P<address_id>\d+)/$',views.UpdateaddressView.as_view(), name="updateaddress"),
    # 设置默认地址
    url(r'^addresses/(?P<address_id>\d+)/default/$', views.DefaultaddressView.as_view(), name="defaultaddress"),
    # 设置修改标签
    url(r'^addresses/(?P<address_id>\d+)/title/$', views.TitleaddressView.as_view(), name="titleaddress"),
    # 修改密码
    url(r'^password/$', views.PasswordView.as_view(), name="password"),
    # 浏览记录
    url(r'^browse_histories/$', views.History.as_view(), name="history"),
]
